﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStandardItemModel>
#include <QFileDialog>
#include <QTextStream>
#include <QDebug>
#include "mybook.h"
#include "mybookinfo.h"
#include <QInputDialog>
#include <QMessageBox>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_actLoadBooks_triggered();

    void on_actLoadLogInfo_triggered();

    void on_actBooks_triggered();

    void on_actLog_triggered();

    void on_actSaveBooks_triggered();

    void on_actSaveLogInfo_triggered();

    void on_btnAppendBook_clicked();

    void on_btnDeleteBook_clicked();

    void on_btnAppendInfo_clicked();

    void on_btnDeleteInfo_clicked();

    void on_combBookType_currentTextChanged(const QString &arg1);

    void on_btnFindBOok_clicked();

    void on_btnFindInfo_clicked();

    void on_btnReturnBook_clicked();

    void on_btnBorrow_clicked();

private:
    Ui::MainWindow *ui;

    void init();

    QStandardItemModel* m_booksModel;
    QStandardItemModel* m_infoModel;

    QList<myBook> m_bookList;
    QList<myBookInfo> m_bookinfoList;
};
#endif // MAINWINDOW_H
